package quickSort;

import org.junit.*;

import sorting.Sorting;
import quickSort.QuickSort;

public class Teste {


	Sorting sorte = new Sorting();
	QuickSort sort2 = new QuickSort();
	int[] array1 = {14,28,1,2,6,9,4,18,7,3,21,2,17,25,15,19,8,16,38,0,29};
	int[] array2 = {0,1,2,2,3,4,6,7,8,9,14,15,16,17,18,19,21,25,28,29,38};


	@Test public void testaBubbleSort(){
		Assert.assertArrayEquals(array2, sorte.bubbleSort(array1));
	}

	@Test public void testaBidirectionalBubbleSort(){
		Assert.assertArrayEquals(array2, sorte.bidirectionalBubbleSort(array1));
	}

	@Test public void testaBidirectionalBubbleSort2(){
		Assert.assertArrayEquals(array2, sorte.bidirectionalBubbleSort2(array1));
	}

	@Test public void testaMergeSort(){		
		Assert.assertArrayEquals(array2, sorte.mergeSort(array1));

	}

	@Test public void testaCoutingSort(){
		Assert.assertArrayEquals(array2, sorte.countingSort(array1));
	}

	@Test public void testaSelectionSort(){
		Assert.assertArrayEquals(array2, sorte.selectionSort(array1));
	}


	@Test public void testaBucketSort(){
		Assert.assertArrayEquals(array2, sorte.bucketSort(array1));
	}

	@Test public void testaInsertionSort(){
		Assert.assertArrayEquals(array2, sorte.insertionSort(array1));
	}

	@Test public void testaQuickSort(){
		Assert.assertArrayEquals(array2, sorte.quickSort(array1, 0, array1.length-1));
	}

	@Test public void testaQuickSortMedia3(){
		Assert.assertArrayEquals(array2, sorte.quickSortMediana3(array1, 0, array1.length-1));
	}
}

